using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing
{
	internal class OracleLpQueryBlockSubquery : OracleLpSubquery
	{
		private OracleLpQueryBlock m_vQueryBlock;

		public override OracleLpSubqueryType SubqueryType => OracleLpSubqueryType.QueryBlock;

		public OracleLpQueryBlock QueryBlock => m_vQueryBlock;

		public OracleLpQueryBlockSubquery(OracleLpStatementElement parent)
			: base(parent)
		{
			m_vQueryBlock = new OracleLpQueryBlock(this);
		}

		public override void Resolve()
		{
			m_vColumnDescriptors = m_vQueryBlock.ColumnDescriptors;
		}

		public override void RetrieveNamedObjectReferences(OracleLpStatement statement)
		{
			m_vQueryBlock.RetrieveNamedObjectReferences(statement);
		}

		internal override void ToString(StringBuilder sb)
		{
			base.ToString(sb);
			m_vQueryBlock.ToString(sb);
		}
	}
}
